
package cn.hz.wolf;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import java.sql.Connection;
public class WzRunner extends Thread{
	private   LinkedBlockingQueue qu=WzSource.qu;
	public void run(){
		while(true){
			try{
				Map<String ,List<Map<String,Object>>> map=new HashMap<>();
				List<Map<String,Object>> listWaiting=MySQLClient.executeQuery(SelectSql.sqlWaiting);
				if(listWaiting.size()==0){
					sleep(WzCfg.tv*2);
					continue;
				}
				List<Map<String,Object>> listWaits=MySQLClient.executeQuery(SelectSql.sqlWaits);
				
				List<Map<String,Object>> listSleep=MySQLClient.executeQuery(SelectSql.sqlSleep);
				map.put("listWaiting", listWaiting);
				map.put("listWaits", listWaits);
				map.put("listSleep", listSleep);
				qu.put(map);
				sleep(WzCfg.tv);
			}catch(Exception e){
				
			}
		}
	}
    
    
    
}